<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<c:set value="${requestScope.response.data.list }" var="list"/>
<jsp:useBean class="com.icss.users.vo.ReUsers" id="pojo"/>
<!DOCTYPE html>
<html lang="en">
	<head>
		<title>下单 - 西餐厅管理系统</title>
		<%@ include file="/common/include/head_title.jsp"%>
	</head>
	<body>
		<jsp:include page="/header.htm"></jsp:include>
		<section class="blog-section spad">
	        <div class="container">
				<form id="form" method="post" class="form-horizontal" action="${rootPath }/head/orders/ordersInsertSubmit.htm" method="post">
					<div class="col-md-10 offset-2">
						<h2
							class="col-sm-10 col-sm-offset-1 form-signin-heading text-center">下单</h2>
						<div class="form-group">
							<label for="email" class="col-sm-3 control-label">收货人姓名:</label>
							<div class="col-sm-8">
								<input type="text" id="receName" name="receName" class="form-control"
									value="${one.receName }" placeholder="收货人姓名">
							</div>
						</div>
						<div class="form-group">
							<label for="inputPassword" class="col-sm-3 control-label">收货人手机:</label>
							<div class="col-sm-8">
								<input type="text" id="recePhone" name="recePhone" class="form-control"
									value="${one.recePhone }" placeholder="收货人手机">
							</div>
						</div>
						<div class="form-group">
							<label for="inputPassword" class="col-sm-3 control-label">收货人地址:</label>
							<div class="col-sm-8">
								<input type="text" id="receAddress" name="receAddress" class="form-control"
									value="${one.receAddress }" placeholder="收货人地址">
							</div>
						</div>
						<div class="form-group">
							<label for="inputPassword" class="col-sm-3 control-label">备注:</label>
							<div class="col-sm-8">
								<input type="text" id="content" name="content" class="form-control"
									value="${one.content }" placeholder="备注">
							</div>
						</div>
					</div>
					
					<div class="col-md-12">
						<h2 class="sub-header">商品明细</h2>
						<div class="table-responsive">
							<table class="table table-striped table-hover">
								<thead>
									<tr>
										<th>序号</th>
										<th>商品</th>
										<th>单价</th>
										<th>数量</th>
										<th>总金额</th>
									</tr>
								</thead>
								<tbody>
									<c:set value="0" var="totalMoney"/>
									<c:forEach items="${list }" var="listTemp" varStatus="stat">
										<tr>
											<td>${stat.count }</td>
											<td title="${listTemp.goods.name }">
												<a href="${rootPath }/goodsInfo.htm?id=${listTemp.goodsId}" target="_blank" title="${listTemp.title }">
													${fn:substring(listTemp.goods.name,0,subStrLen) }
												</a>
											</td>
											<td>${listTemp.goods.price }</td>
											<td>${listTemp.num }</td>
											<td>${listTemp.goods.price * listTemp.num }</td>
											<c:set value="${totalMoney + listTemp.goods.price * listTemp.num }" var="totalMoney"/>
										</tr>
									</c:forEach>
									<tr>
										<td colspan="4" style="text-align: right">
											<strong>总价格 =</strong></td>
										<td class="label label-important" style="display: block">
											<strong>${totalMoney }</strong></td>
									</tr>
								</tbody>
							</table>
							<input type="submit" value="提交订单" class="btn btn-md btn-primary pull-right">
						</div>
					</div>
					
				</form>
			</div>
	    </section>
		<%@ include file="/common/include/head_footer.jsp"%>
	</body>
</html>